<?php

namespace Admin\Controller;
use Admin\Model\NodeModel;

class IndexController extends BaseController
{
    public function index()
    {
        if(empty(session('username'))){
            $this->redirect('/admin/login/');
        }

        // 获取权限菜单
           $node = new NodeModel();
            $this->assign([
                'menu' => $node->getMenu(session('rule'))
            ]);

        return $this->display('/index');
    }

    /**
     * 后台默认首页
     * @return mixed
     */
    public function indexPage()
    {
        return $this->display('index/index');
    }
}

?>
